﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Administration/Administration.Master"
    AutoEventWireup="true" CodeBehind="Curs.aspx.cs" Inherits="IEWebSite.Administration.Curs"
    EnableEventValidation="false" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <h1>
        Cursuri Zi/ID/Master/Phd</h1>
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">

        <script type="text/javascript">
            function RowDblClick(sender, eventArgs) {
                sender.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical());
            }

            //on insert and update buttons click temporarily disables ajax to perform upload actions
            function conditionalPostback(e, sender) {
                var theRegexp = new RegExp("\.UpdateButton$|\.PerformInsertButton$", "ig");
                if (sender.EventTarget.match(theRegexp)) {
                    var upload = window['UploadId'];

                    //AJAX is disabled only if file is selected for upload
                    if (upload.GetFileInputs()[0].value != "") {
                        sender.EnableAjax = false;
                    }
                }
            }
        </script>

    </telerik:RadCodeBlock>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" 
    EnableAJAX="False" EnablePageHeadUpdate="False">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                   <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadGrid ID="RadGrid1" runat="server" GridLines="None" AllowPaging="True"
        Skin="Sunset" AllowSorting="True" OnInsertCommand="RadGrid1_InsertCommand" OnNeedDataSource="RadGrid1_NeedDataSource"
        OnUpdateCommand="RadGrid1_UpdateCommand" OnDeleteCommand="RadGrid1_DeleteCommand"
        AutoGenerateDeleteColumn="True" AutoGenerateEditColumn="True" OnColumnCreated="RadGrid1_ColumnCreated">
        <ClientSettings>
            <ClientEvents OnRowDblClick="RowDblClick" />
        </ClientSettings>
        <MasterTableView CommandItemDisplay="Top" DataKeyNames="IdCurs">
            <EditFormSettings UserControlName="EditCurs.ascx" EditFormType="WebUserControl">
                <EditColumn UniqueName="EditCommandColumn1">
                </EditColumn>
            </EditFormSettings>
        </MasterTableView>
    </telerik:RadGrid>
</asp:Content>
